Optimal. Leaf size=54 \[ -\frac {(a+b)^2 \text {ArcTan}\left (\frac {\sqrt {b} \cos (x)}{\sqrt {a}}\right )}{\sqrt {a} b^{5/2}}+\frac {(a+2 b) \cos (x)}{b^2}-\frac {\cos ^3(x)}{3 b} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.05, antiderivative size = 54, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 3, integrand size = 15, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.200, Rules used = {3269, 398, 211}
\begin {gather*} -\frac {(a+b)^2 \text {ArcTan}\left (\frac {\sqrt {b} \cos (x)}{\sqrt {a}}\right )}{\sqrt {a} b^{5/2}}+\frac {(a+2 b) \cos (x)}{b^2}-\frac {\cos ^3(x)}{3 b} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 211
Rule 398
Rule 3269
Rubi steps
\begin {align*} \int \frac {\sin ^5(x)}{a+b \cos ^2(x)} \, dx &=-\text {Subst}\left (\int \frac {\left (1-x^2\right )^2}{a+b x^2} \, dx,x,\cos (x)\right )\\ &=-\text {Subst}\left (\int \left (-\frac {a+2 b}{b^2}+\frac {x^2}{b}+\frac {a^2+2 a b+b^2}{b^2 \left (a+b x^2\right )}\right ) \, dx,x,\cos (x)\right )\\ &=\frac {(a+2 b) \cos (x)}{b^2}-\frac {\cos ^3(x)}{3 b}-\frac {(a+b)^2 \text {Subst}\left (\int \frac {1}{a+b x^2} \, dx,x,\cos (x)\right )}{b^2}\\ &=-\frac {(a+b)^2 \tan ^{-1}\left (\frac {\sqrt {b} \cos (x)}{\sqrt {a}}\right )}{\sqrt {a} b^{5/2}}+\frac {(a+2 b) \cos (x)}{b^2}-\frac {\cos ^3(x)}{3 b}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(116\) vs. \(2(54)=108\).
time = 0.19, size = 116, normalized size = 2.15 \begin {gather*} \frac {-\frac {12 (a+b)^2 \text {ArcTan}\left (\frac {\sqrt {b}-\sqrt {a+b} \tan \left (\frac {x}{2}\right )}{\sqrt {a}}\right )}{\sqrt {a}}-\frac {12 (a+b)^2 \text {ArcTan}\left (\frac {\sqrt {b}+\sqrt {a+b} \tan \left (\frac {x}{2}\right )}{\sqrt {a}}\right )}{\sqrt {a}}+3 \sqrt {b} (4 a+7 b) \cos (x)-b^{3/2} \cos (3 x)}{12 b^{5/2}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.16, size = 57, normalized size = 1.06
method | result | size |
default | \(\frac {-\frac {b \left (\cos ^{3}\left (x \right )\right )}{3}+a \cos \left (x \right )+2 b \cos \left (x \right )}{b^{2}}+\frac {\left (-a^{2}-2 a b -b^{2}\right ) \arctan \left (\frac {b \cos \left (x \right )}{\sqrt {a b}}\right )}{b^{2} \sqrt {a b}}\) | \(57\) |
risch | \(\frac {a \,{\mathrm e}^{i x}}{2 b^{2}}+\frac {7 \,{\mathrm e}^{i x}}{8 b}+\frac {{\mathrm e}^{-i x} a}{2 b^{2}}+\frac {7 \,{\mathrm e}^{-i x}}{8 b}-\frac {i \ln \left ({\mathrm e}^{2 i x}+\frac {2 i a \,{\mathrm e}^{i x}}{\sqrt {a b}}+1\right ) a^{2}}{2 \sqrt {a b}\, b^{2}}-\frac {i \ln \left ({\mathrm e}^{2 i x}+\frac {2 i a \,{\mathrm e}^{i x}}{\sqrt {a b}}+1\right ) a}{\sqrt {a b}\, b}-\frac {i \ln \left ({\mathrm e}^{2 i x}+\frac {2 i a \,{\mathrm e}^{i x}}{\sqrt {a b}}+1\right )}{2 \sqrt {a b}}+\frac {i \ln \left ({\mathrm e}^{2 i x}-\frac {2 i a \,{\mathrm e}^{i x}}{\sqrt {a b}}+1\right ) a^{2}}{2 \sqrt {a b}\, b^{2}}+\frac {i \ln \left ({\mathrm e}^{2 i x}-\frac {2 i a \,{\mathrm e}^{i x}}{\sqrt {a b}}+1\right ) a}{\sqrt {a b}\, b}+\frac {i \ln \left ({\mathrm e}^{2 i x}-\frac {2 i a \,{\mathrm e}^{i x}}{\sqrt {a b}}+1\right )}{2 \sqrt {a b}}-\frac {\cos \left (3 x \right )}{12 b}\) | \(253\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.49, size = 53, normalized size = 0.98 \begin {gather*} -\frac {{\left (a^{2} + 2 \, a b + b^{2}\right )} \arctan \left (\frac {b \cos \left (x\right )}{\sqrt {a b}}\right )}{\sqrt {a b} b^{2}} - \frac {b \cos \left (x\right )^{3} - 3 \, {\left (a + 2 \, b\right )} \cos \left (x\right )}{3 \, b^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.43, size = 152, normalized size = 2.81 \begin {gather*} \left [-\frac {2 \, a b^{2} \cos \left (x\right )^{3} + 3 \, {\left (a^{2} + 2 \, a b + b^{2}\right )} \sqrt {-a b} \log \left (-\frac {b \cos \left (x\right )^{2} + 2 \, \sqrt {-a b} \cos \left (x\right ) - a}{b \cos \left (x\right )^{2} + a}\right ) - 6 \, {\left (a^{2} b + 2 \, a b^{2}\right )} \cos \left (x\right )}{6 \, a b^{3}}, -\frac {a b^{2} \cos \left (x\right )^{3} + 3 \, {\left (a^{2} + 2 \, a b + b^{2}\right )} \sqrt {a b} \arctan \left (\frac {\sqrt {a b} \cos \left (x\right )}{a}\right ) - 3 \, {\left (a^{2} b + 2 \, a b^{2}\right )} \cos \left (x\right )}{3 \, a b^{3}}\right ] \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.41, size = 59, normalized size = 1.09 \begin {gather*} -\frac {{\left (a^{2} + 2 \, a b + b^{2}\right )} \arctan \left (\frac {b \cos \left (x\right )}{\sqrt {a b}}\right )}{\sqrt {a b} b^{2}} - \frac {b^{2} \cos \left (x\right )^{3} - 3 \, a b \cos \left (x\right ) - 6 \, b^{2} \cos \left (x\right )}{3 \, b^{3}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.10, size = 65, normalized size = 1.20 \begin {gather*} \cos \left (x\right )\,\left (\frac {a}{b^2}+\frac {2}{b}\right )-\frac {{\cos \left (x\right )}^3}{3\,b}-\frac {\mathrm {atan}\left (\frac {\sqrt {b}\,\cos \left (x\right )\,{\left (a+b\right )}^2}{\sqrt {a}\,\left (a^2+2\,a\,b+b^2\right )}\right )\,{\left (a+b\right )}^2}{\sqrt {a}\,b^{5/2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________